package com.fw.system.admin.service.impl;

import java.util.List;
import com.fw.common.IdXD;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.fw.system.admin.mapper.TbGunsLogMapper;
import com.fw.system.admin.domain.TbGunsLog;
import com.fw.system.admin.service.ITbGunsLogService;
import com.fw.utils.DateUtils;

/**
 * 装备购买出售记录Service业务层处理
 * 
 * @author xxx
 * @date 2021-12-03
 */
@Service
public class TbGunsLogServiceImpl extends ServiceImpl<TbGunsLogMapper, TbGunsLog> implements ITbGunsLogService
{
    @Autowired
    private TbGunsLogMapper tbGunsLogMapper;

    @Autowired
    private IdXD idXD;

    /**
     * 查询装备购买出售记录
     * 
     * @param id 装备购买出售记录ID
     * @return 装备购买出售记录
     */
    @Override
    public TbGunsLog selectTbGunsLogById(String id)
    {
        return tbGunsLogMapper.selectTbGunsLogById(id);
    }

    /**
     * 查询装备购买出售记录列表
     * 
     * @param tbGunsLog 装备购买出售记录
     * @return 装备购买出售记录
     */
    @Override
    public List<TbGunsLog> selectTbGunsLogList(TbGunsLog tbGunsLog)
    {
        return tbGunsLogMapper.selectTbGunsLogList(tbGunsLog);
    }

    /**
     * 新增装备购买出售记录
     * 
     * @param tbGunsLog 装备购买出售记录
     * @return 结果
     */
    @Override
    public int insertTbGunsLog(TbGunsLog tbGunsLog)
    {
        tbGunsLog.setCreateTime(DateUtils.getNowDate());
        tbGunsLog.setId(idXD.nextId());
        return tbGunsLogMapper.insertTbGunsLog(tbGunsLog);
    }

    /**
     * 修改装备购买出售记录
     * 
     * @param tbGunsLog 装备购买出售记录
     * @return 结果
     */
    @Override
    public int updateTbGunsLog(TbGunsLog tbGunsLog)
    {
        return tbGunsLogMapper.updateTbGunsLog(tbGunsLog);
    }

    /**
     * 批量删除装备购买出售记录
     * 
     * @param ids 需要删除的装备购买出售记录ID
     * @return 结果
     */
    @Override
    public int deleteTbGunsLogByIds(String[] ids)
    {
        return tbGunsLogMapper.deleteTbGunsLogByIds(ids);
    }

    /**
     * 删除装备购买出售记录信息
     * 
     * @param id 装备购买出售记录ID
     * @return 结果
     */
    @Override
    public int deleteTbGunsLogById(String id)
    {
        return tbGunsLogMapper.deleteTbGunsLogById(id);
    }
}
